package com.ccp.dev.system.model;

import com.ccp.dev.core.basic.model.BaseModel;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.Objects;

/**
 * 用户角色映射表 Model对象
 * @author  y
 */
public class UserRole extends BaseModel
{
	/**
	 * 用户角色Id
	 */
	protected String userRoleId;
	/**
	 * 角色ID
	 */
	protected String roleId;
	/**
	 * 用户ID
	 */
	protected String userId;
	/**
	 * 姓名
	 */
	protected String fullName;
	/**
	 * 帐号
	 */
	protected String account;
	/**
	 * 角色名称
	 */
	protected String roleName="";
	/**
	 * 系统名称
	 */
	protected String systemName="";

	public String getUserRoleId() {
		return userRoleId;
	}

	public void setUserRoleId(String userRoleId) {
		this.userRoleId = userRoleId;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getSystemName() {
		return systemName;
	}

	public void setSystemName(String systemName) {
		this.systemName = systemName;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {return true;}
		if (o == null || getClass() != o.getClass()) {return false;}
		UserRole userRole = (UserRole) o;
		return Objects.equals(userRoleId, userRole.userRoleId) &&
				Objects.equals(roleId, userRole.roleId) &&
				Objects.equals(userId, userRole.userId) &&
				Objects.equals(fullName, userRole.fullName) &&
				Objects.equals(account, userRole.account) &&
				Objects.equals(roleName, userRole.roleName) &&
				Objects.equals(systemName, userRole.systemName);
	}

	@Override
	public int hashCode() {
		return Objects.hash(userRoleId, roleId, userId, fullName, account, roleName, systemName);
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this)
				.append("userRoleId", userRoleId)
				.append("roleId", roleId)
				.append("userId", userId)
				.append("fullName", fullName)
				.append("account", account)
				.append("roleName", roleName)
				.append("systemName", systemName)
				.append("createBy", createBy)
				.append("createTime", createTime)
				.append("updateTime", updateTime)
				.append("updateBy", updateBy)
				.append("tenantId", tenantId)
				.toString();
	}
}